how to return variable from transaction laravel

107

$result = null;
DB::transaction(function () use(&$result) { 
    // logic here
    $result = someGetResult();
});
if ($result != null) {

}

Comments

Submit
0 Comments